package com.exposit.books.web;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.exposit.books.domain.NewBooks;
import com.exposit.books.service.NewBooksService;

@Controller
@RequestMapping("/newbook")
public class NewBooksController {
	@Autowired
	private NewBooksService newbooksservice;
	@RequestMapping(value = "/newbook", method = RequestMethod.GET)
	public String getAllPreOrders(Model model) {

		List<NewBooks> listOrder = newbooksservice.getAllNewBooks();
        model.addAttribute("listOrder", listOrder);

		return "newbook";
	}


}
